package cn.edu.ujn.bmis.service.imp;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import cn.edu.ujn.bmis.dao.BookDao;
import cn.edu.ujn.bmis.model.Book;
import cn.edu.ujn.bmis.service.BookManager;

@Component("bookManager")
public class BookManagerImp implements BookManager {
	
	private BookDao bookDao;

	public boolean addBook(Book book) {
		
		return bookDao.saveBook(book);
	}

	public BookDao getBookDao() {
		return bookDao;
	}
	
	@Resource(name="bookDao")
	public void setBookDao(BookDao bookDao) {
		this.bookDao = bookDao;
	}

	public boolean update(String hql) {
		return bookDao.update(hql);
	}

	public boolean update(Book book) {
		return bookDao.update(book);
	}

	public List<Book> findBook(String hql) {
		
		return bookDao.findBook(hql) ;
	}
}
